package com.cxb.springboot.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Classname FileController
 * @Date 2023/4/14 22:56
 * @Created by Administrator
 * @Description TODO
 */
@Slf4j
@RestController
@RequestMapping("/upload")
@Api(value = "FileController", tags = "文件上传")
public class FileController {

    @PostMapping("/file")
    @ApiOperation(value = "文件上传", httpMethod = "POST")
    public String uploadFile(@RequestParam("file") MultipartFile file) {
        log.info("文件名:{}", file.getOriginalFilename());
        return file.getOriginalFilename();
    }
}
